]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
sessionMode: Add hasRunDialog property
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 17 May 2012 11:41:02 +0000 (13:41 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 22 May 2012 17:42:28 +0000 (19:42 +0200)
Add a sessionMode.hasRunDialog property, which determines whether
the keyboard shortcut to access the run dialog should be active
or not.

https://bugzilla.gnome.org/show_bug.cgi?id=676156

js/ui/main.js
js/ui/sessionMode.js

index 66340255f6e903bc251ee93c3753df287f615862..04f04450962d30fa389fb6863715572bbb358e90 100644 (file)
@@ -135,10 +135,6 @@ function _initUserSession() {
     _initRecorder();
 
     global.screen.override_workspace_layout(Meta.ScreenCorner.TOPLEFT, false, -1, 1);
-
-    Meta.keybindings_set_custom_handler('panel-run-dialog', function() {
-       getRunDialog().open();
-    });
 }
 
 function start() {
@@ -231,6 +227,12 @@ function start() {
         ExtensionSystem.loadExtensions();
     }
 
+    if (sessionMode.hasRunDialog) {
+        Meta.keybindings_set_custom_handler('panel-run-dialog', function() {
+           getRunDialog().open();
+        });
+    }
+
     if (sessionMode.hasOverview) {
         Meta.keybindings_set_custom_handler('panel-main-menu', function () {
             overview.toggle();
@@ -610,6 +612,9 @@ function _globalKeyPressHandler(actor, event) {
             return true;
         case Meta.KeyBindingAction.PANEL_RUN_DIALOG:
         case Meta.KeyBindingAction.COMMAND_2:
+            if (!sessionMode.hasRunDialog)
+                return false;
+
             getRunDialog().open();
             return true;
         case Meta.KeyBindingAction.PANEL_MAIN_MENU:
index c66e92f0446ad880faedbe2b7607dd7df096c77b..a3edec5ae24705f37493e3ed8f5a9404c7455ff4 100644 (file)
@@ -14,6 +14,7 @@ const _modes = {
              allowSettings: false,
              allowExtensions: false,
              allowKeybindingsWhenModal: true,
+             hasRunDialog: false,
              sessionType: Shell.SessionType.GDM },
 
     'user': { hasOverview: true,
@@ -22,6 +23,7 @@ const _modes = {
               allowSettings: true,
               allowExtensions: true,
               allowKeybindingsWhenModal: false,
+              hasRunDialog: true,
               sessionType: Shell.SessionType.USER }
 };